using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SO_Bill_BAL_GUAR1_FASTMap : EntityTypeConfiguration<SO_Bill_BAL_GUAR1_FAST>
    {
        public SO_Bill_BAL_GUAR1_FASTMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Type, t.DATE, t.Guarantor1_Amount, t.Bill_Currency, t.currency });

            // Properties
            this.Property(t => t.Bill__)
                .HasMaxLength(8);

            this.Property(t => t.Type)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.Guarantor_1)
                .HasMaxLength(80);

            this.Property(t => t.Guarantor1__)
                .HasMaxLength(6);

            this.Property(t => t.Document__)
                .HasMaxLength(8);

            this.Property(t => t.Bill_Currency)
                .IsRequired()
                .HasMaxLength(5);

            this.Property(t => t.currency)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("SO_Bill_BAL_GUAR1_FAST");
            this.Property(t => t.Bill__).HasColumnName("Bill_#");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.DATE).HasColumnName("DATE");
            this.Property(t => t.closed).HasColumnName("closed");
            this.Property(t => t.Guarantor_1).HasColumnName("Guarantor_1");
            this.Property(t => t.Guarantor1__).HasColumnName("Guarantor1_#");
            this.Property(t => t.Document__).HasColumnName("Document_#");
            this.Property(t => t.Guarantor1_Amount).HasColumnName("Guarantor1_Amount");
            this.Property(t => t.Bill_Currency).HasColumnName("Bill_Currency");
            this.Property(t => t.currency).HasColumnName("currency");
            this.Property(t => t.Guarantor1_balance).HasColumnName("Guarantor1_balance");
        }
    }
}
